package com.dfe.backend.common.constant;

import cn.hutool.core.util.StrUtil;

/**
 * 【描述】：线缆类型
 *
 * @author LiChang
 * @since 2025-9-18 10:14
 */
public enum CableEnum {

    // 公司类型
    Control("ControlCable", "Control", "控制电缆"),
    Power("PowerCable", "Power", "电力电缆"),
    Computer("ComputerCable", "Computer", "计算机电缆"),
    Fiber("FiberCable", "Fiber", "光缆"),
    Ethernet("EthernetCable", "Ethernet", "以太网线"),
    Pigtail("PigtailCable", "Pigtail", "尾缆"),
    Coaxial("CoaxialCable", "Coaxial", "同轴电缆"),
    Other("Other", "Other", "其他");

    public final String cableClass;
    public final String cableShortClass;
    public final String desc;

    CableEnum(String cableClass, String cableShortClass, String desc) {
        this.cableClass = cableClass;
        this.cableShortClass = cableShortClass;
        this.desc = desc;
    }

    /**
     * 【描述】: 根据线缆的class获取线缆类型描述
     *
     * @param cableClass cableClass
     * @return {@link String}
     * @author LiChang
     * @since 2025-9-18 10:24
     */
    public static String getCableTypeDesc(String cableClass) {
        if (StrUtil.isNotEmpty(cableClass)) {
            for (CableEnum enums : CableEnum.values()) {
                if (cableClass.equals(enums.cableClass) || cableClass.equals(enums.cableShortClass)) {
                    return enums.desc;
                }
            }
        }
        return "未知类型";
    }

}
